SELF_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
_VERSION=1.2.5

all: $(SELF_DIR)/zlib-$(_VERSION).tar.gz
	rm -rf zlib-$(_VERSION)
	tar xvzf $^
	cd zlib-$(_VERSION)               &&\
          ./configure --static            &&\
          make CC="arm-marvell-eabi-gcc"    \
               CFLAGS="-O3"                 \
               AR="arm-marvell-eabi-ar rc"  \
               libz.a                     &&\
          cp libz.a ../lib                &&\
          make distclean
